﻿using Microsoft.Xna.Framework;
using RainEngine.Rendering;
using RainEngine.SceneManagement;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using RainEngine.Effects;

namespace RainEngine.SceneNodes
{
    /// <summary>
    /// 创建一个立方体
    /// </summary>
    public class CubeSceneNode : GenericSceneNode
    {
        /// <summary>
        /// 创建一个新CubeSceneNode对象，不使用细节纹理。
        /// </summary>
        /// <param name="engine">引擎</param>
        /// <param name="setScene">所属场景</param>
        /// <param name="setDiffuseTextureName">立方体使用的漫反射纹理</param>
        public CubeSceneNode(GraphicsDevice graphicsDevice, ContentManager setContent, Scene setScene, string diffuseTextureName) : this(graphicsDevice, setContent, setScene, diffuseTextureName, null) { }

        /// <summary>
        /// 创建一个新CubeSceneNode对象，使用细节纹理。
        /// </summary>
        /// <param name="engine">引擎</param>
        /// <param name="setScene">所属场景</param>
        /// <param name="setDiffuseTextureName">立方体使用的漫反射纹理</param>
        /// <param name="setDiffuseTiles">漫反射纹理UV重复次数</param>
        /// <param name="setDetailTextureName">立方体使用的细节纹理</param>
        /// <param name="setDetailTiles">细节纹理UV重复次数</param>
        public CubeSceneNode(GraphicsDevice graphicsDevice, ContentManager setContent, Scene setScene, string setDiffuseTextureName, string setDetailTextureName)
            : base(graphicsDevice, setContent, setScene,setDiffuseTextureName,setDetailTextureName)
        {            
        }        

        public override void Initialize()
        {
            base.Initialize();
            this.mesh = MeshBuilder.CreateCube(graphicsDevice);
        } 
        
    }
}
